package com.hkbigdata.transform;

import org.apache.flink.streaming.api.datastream.ConnectedStreams;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author liuanbo
 * @creat 2024-04-11-15:45
 * @see 2194550857@qq.com
 */
public class Flink06_TransForm_Connect_Anonymous {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        DataStreamSource<Integer> integerDataStreamSource = env.fromElements(1, 2, 3, 4, 5, 6);
        DataStreamSource<String> stringDataStreamSource = env.fromElements("a", "b", "c", "d");

        ConnectedStreams<Integer, String> connect = integerDataStreamSource.connect(stringDataStreamSource);

        connect.getFirstInput().print("first");
        connect.getSecondInput().print("second");

        env.execute();




    }
}
